home *** CD-ROM | disk | FTP | other *** search
- /****************************************************************
- * batcher.c - AmigaDos batch file processor *
- * *
- * Copyright(C) 1986, W. Wesley Howe - All Rights Reserved *
- * A limited Right of Non-Commercial copying & use *
- * is granted, provided this notice is also copied. *
- * No warranties are expressed on the suitability *
- * of this program for any use is conveyed or implied. *
- * *
- * Purpose: To allow usage of batch files without having to *
- * use the Execute command. Primarily for those who *
- * want to make system usage easy for the less *
- * literate, and those of us that are plain lazy. *
- * *
- * Usage: Rename your AmigaDos batch file to end with ".bat" *
- * (must not contain any spaces in filename), then *
- * rename the compiled version of this program to the *
- * old name of the batch file. *
- * *
- * Compile: Compile with Lattice "C" V.3.03. Use -v -s options *
- * on lc2 for a small (2320 byte) executable file *
- * (link as normal with Alink). Normal with Alink *
- * means it takes longer to link this than to compile *
- * the whole thing. *
- * *
- * Warnings: All of the normal support of AmigaDos is missing *
- * from this program (No stdin, stdout, etc.) These *
- * facilities are restored when the program calls *
- * Execute(). Program has not been tested from the *
- * Workbench (I never use it.) *
- * *
- ****************************************************************/
-
- #define LINELEN 128
- char ExecLine[LINELEN] = "execute ";
- char BatchExt[] = ".bat ";
-
- _main(CmdLine) /* shortcut around main() */
- char *CmdLine;
- {
- int c, j = 8, i = 0;
- while((c=(*(CmdLine++)))!=' ') ExecLine[j++]=c; /* gets own name */
- while(ExecLine[j++]=BatchExt[i++]); /* append .bat */
- --j; /* point at terminator */
- if(c) while(ExecLine[j++]=(*(CmdLine++))); /* remainder of CmdLine */
- Execute(ExecLine, 0, 0); /* see AmigaDos manual */
- _exit(0); /* no level 2 support */
- }
- /* that's all, folks. */
-
-